#include <iostream>
#include "Package.h"

using std::cout;
using std::endl;


Package::Package( double w, double c,
        char* fName, char* fAddress, char* fCity, char* fState, char* fZIP,
        char* tName, char* tAddress, char* tCity, char* tState, char* tZIP ) :
    _fromName(fName), _fromAddress(fAddress), _fromCity(fCity), _fromState(fState), _fromZIP(fZIP), _toName(tName), _toAddress(tAddress), _toCity(tCity), _toState(tState), _toZIP(tZIP)
{
    _weight = w > 0 ? w : 0;
    _costPerKilo = c > 0 ? c : 0;
}

Package::~Package()
{
}

double Package::getWeight() const
{
    return _weight;
}

double Package::getCostPerKilo() const
{
    return _costPerKilo;
}

char* Package::getFromAddress() const
{
    return _fromAddress;
}

char* Package::getToAddress() const
{
    return _toAddress;
}

double Package::calculateCost() const
{
    return getWeight() * getCostPerKilo();
}

void Package::printCost() const
{
    cout << "Costs from Package:" << endl;
    cout << "From: " << _fromAddress << endl;
    cout << "TO  : " << _toAddress << endl;
    cout << "Cost: R$ " << calculateCost() << endl << endl;
}

